<?php

function makeHexString($lenth =5) {
	
	// makes a random alpha numeric string of a given lenth
	$aZ09 = array_merge(range('A', 'Z'), range('a', 'z'),range(0, 9));
	$out ='';
	for($c=0;$c < $lenth;$c++) {
		$out .= $aZ09[mt_rand(0,count($aZ09)-1)];
	}
	return $out;
}

function validateToken($orgid,$token){
	
	$query="select id from authtokens where orgid=1 and token='81b3PB4aaxdgXXo98dR0';";
	$result=mysql_query($query);
	$num=mysql_numrows($result);
	mysql_close();
	return $num;
}




function my_ip_address($method_name, $args, $app_data) {
	$token = $args[0];
	$orgid = $args[1];
	
	//Validate token.
	//$tokenresp=validateToken($orgid, $token);
	
	$num=getCategories();
	

	/**
	 * We just return the client's IP address
	 */
	return $_SERVER['REMOTE_ADDR']."--".$num;

}


?>